<include file="Public:header"/>
<div class="cat">
<img onclick="add()" src="__APP__/statics/add_cat.gif" />
<table bordercolor="#DDDFFF" border="1" width="100%" style="border-collapse: collapse" cellpadding="3">
	<tr height="17" align="center">
		<td class="title" width="200">变量</td>
		<td class="title" width="200">名称</td>
		<td class="title" width="100">查看/修改内容</td>
		<td class="title">备注</td>
		<td class="title" width="80">添加时间</td>
		<td class="title" width="40">删除</td>
		<td class="title">　</td>
	</tr>
<volist name="variable" id="variable">
	<tr height="20" bgcolor="#F1F5FA" class="cat_list">
		<td width="200" style="font-weight:bold">{$variable.global_key}</td>
		<td width="200">{$variable.global_name}</td>
		<td width="80" align="center"><a href="javascript:;" onclick="edit({$variable.id})"><img src="__APP__/statics/add44.gif"></a></td>
		<td align="center">{$variable.note}</td>
		<td width="80">{$variable.create_time|date="Y-m-d",###}</td>
		<td width="40" align="center"><a href="javascript:;" onclick="deletes({$variable.id})"><img alt="删除" src="__APP__/statics/icons/icon_delete.gif"></a></td>
		<td></td>
	</tr>
</volist>
</table>
</div>

<script>
function deletes(t){
    var gid=t;
	if(confirm('你确认删除此变量吗？删除后请同时修改使用过此变量的商品信息！')) {
       $.ajax({
	       type:"GET",
		   url:"__URL__/remove",
		   dataType:"json",
		   data:{"gid":gid},
		   success:function(data){
               if(data=='1'){
				   jSuccess("<strong>删除成功！</strong>",{TimeShown : 500,VerticalPosition : 'center',HorizontalPosition : 'center',onClosed:function(){location.reload();}})
			  }else{
			      jError("<strong>删除失败!请重试</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
			 }
		   }
	   })

	}
}
</script>
<script src="__APP__/statics/webox/webox.js"></script>
<link href="__APP__/statics/webox/jquery-webox.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function add(){
		$.webox({
		    scroll:'no',
			height:465,
			width:950,
			bgvisibel:true,
			title:'添加全局变量',
			iframe:'__URL__/add/'+Math.random
		});
}
function edit(t){
       var gid=t;
		$.webox({
		    scroll:'no',
			height:465,
			width:950,
			bgvisibel:true,
			title:'修改全局变量',
			iframe:'__URL__/edit/?gid='+gid
		});
}
</script>
